<?php require VIEWPATH. ADMIN_DIR. DIRECTORY_SEPARATOR. 'header.php'?>
    <style>
        .form-control{
			border: none;
			height: auto;
		}
		.img img{
			width: 200px;
			height: 200px;
			object-fit: cover;
			margin: 15px;
		}
		#cboxClose{
			text-indent: 0;
			font-size: 50px;
			font-weight: bold;
			margin-top: 10px;
			color: red;
		}
    </style>
	<div class="page-header">
		<h1>
			<a class="a-back" href="<?= admin_url('moral/activity') ?>">
				<i class="fa fa-reply"></i>
			</a>
			德育活动详情
		</h1>
	</div>
	<div class="col-xs-12">
		<form class="form-horizontal" id="activity-form">
            <input type="hidden" name="id" value="<?=isset($activity) ? $activity['id'] : 0?>" />
            <input type="hidden" name="material" value="<?=isset($activity) ? $activity['material'] : '' ?>" />
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">学生名称：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['student_realname'] ?>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">审核状态：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['state'] ?>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">活动时间：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['act_time'] ?>
					</div>
				</div>	
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">活动时长：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['duration'] ?>分钟
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">活动方式：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['mode'] ?>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">活动地点：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['dest'] ?>
					</div>
				</div>
            </div>
            <div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">活动内容：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['content'] ?>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right">活动收获：</label>
				<div class="col-sm-6">
					<div class="form-control">
						<?= $activity['harvest'] ?>
					</div>
				</div>
			</div>
			<?php if($activity['remark_user_id']): ?>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right">审核人：</label>
					<div class="col-sm-6">
						<div class="form-control">
							<?= $activity['teacher_realname'] ?>
						</div>
					</div>
				</div>
			<?php endif ?>	
			<?php if(trim($activity['remark'])): ?>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right">评语：</label>
					<div class="col-sm-6">
						<div class="form-control">
							<?= $activity['remark'] ?>
						</div>
					</div>
				</div>
			<?php endif ?>
			<?php if(isset($activity['imgArr'])): ?>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right">证明材料：</label>
					<div class="col-sm-6">
						<div class="form-control">
							<div class="img ace-thumbnails">
								<?php foreach($activity['imgArr'] as $img): ?>
									<a href="<?= $img ?>" data-rel="colorbox" class="cboxElement">
										<img class="img-preview" src="<?= $img ?>" />
									</a>
								<?php endforeach ?>
							</div>
						</div>
					</div>
				</div>
			<?php endif ?>
		</form>
	</div>
<?php require VIEWPATH. ADMIN_DIR. DIRECTORY_SEPARATOR. 'footer.php'?>
<script type="text/javascript">
	$(function(){
		// 图片轮播
		var colorbox_params = {
			rel: 'colorbox',
			reposition:true,
			scalePhotos:true,
			scrolling:false,
			previous:'<i class="ace-icon fa fa-arrow-left"></i>',
			next:'<i class="ace-icon fa fa-arrow-right"></i>',
			close:'&times;',
			current:'',
			maxWidth:'100%',
			maxHeight:'100%',
			onOpen:function(){
				$overflow = document.body.style.overflow;
				document.body.style.overflow = 'hidden';
			},
			onClosed:function(){
				document.body.style.overflow = $overflow;
			},
			onComplete:function(){
				$.colorbox.resize();
			}
		};
		$('.ace-thumbnails [data-rel="colorbox"]').colorbox(colorbox_params);
	})
</script>